package com.sxau.software_educational_system_backend.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 
 * @TableName worker_student
 */
@TableName(value ="worker_student")
@Data
public class WorkerStudent {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    private String name;

    /**
     * 
     */
    private String phone;

    /**
     * 就业状态 1为普通就业学员 2为明星就业学员
     */
    private Integer workerState;

    /**
     * 就业单位
     */
    private String unit;

    /**
     * 
     */
    private Date graduatedTime;

    /**
     * 学号
     */
    private String studentId;

    /**
     * 头像
     */
    private String img;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WorkerStudent other = (WorkerStudent) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getWorkerState() == null ? other.getWorkerState() == null : this.getWorkerState().equals(other.getWorkerState()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getGraduatedTime() == null ? other.getGraduatedTime() == null : this.getGraduatedTime().equals(other.getGraduatedTime()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            &&  (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getWorkerState() == null) ? 0 : getWorkerState().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getGraduatedTime() == null) ? 0 : getGraduatedTime().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", phone=").append(phone);
        sb.append(", workerState=").append(workerState);
        sb.append(", unit=").append(unit);
        sb.append(", graduatedTime=").append(graduatedTime);
        sb.append(", studentId=").append(studentId);
        sb.append(", img=").append(img);
        sb.append("]");
        return sb.toString();
    }
}